package com.youi.service;

import com.google.protobuf.TextFormat.ParseException;
import com.youi.entity.Userorder;
import com.youi.entity.vo.ExportMerchantOrderVO;
import com.youi.entity.vo.ExportOrderVO;
import com.youi.entity.vo.ExportPlatformOrderVO;
import com.youi.entity.vo.UserorderexcelVo;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface UserorderService extends BaseService<Userorder> {

    /**
     * 获取订单信息
     *
     * @param userorderList
     */
    public void getUserordermsg(List<Userorder> userorderList);

    /**
     * 获取订单信息
     *
     * @param userorder
     */
    public void getUserordermsg(Userorder userorder);

    /**
     * 导入快递单信息
     *
     * @param multipartFile
     * @param book
     * @throws ParseException
     * @throws BiffException
     * @throws IOException
     */
    public void improtExpressExcel(CommonsMultipartFile multipartFile, Workbook book) throws ParseException, BiffException, IOException;

    /**
     * 订单导出工具
     *
     * @param request
     * @param userorderexcelList
     * @return
     */
    public void tocreatedExcel(HttpServletRequest request, List<UserorderexcelVo> userorderexcelList);

    /**
     * 快递单导出工具
     *
     * @param request
     * @param userorderList
     * @return
     */
    public String toExpressExcel(HttpServletRequest request, List<Userorder> userorderList);

    /**
     * 查询订单列表
     *
     * @param params
     * @param searchParams
     * @param otherParams
     * @param merchantParams
     * @param sortParams
     * @param pageIndex
     * @param pageNum
     * @param gtParams
     * @param ltParams
     * @return
     */
    public List<Userorder> getUserorderList(Map<String, Object> params, Map<String, Object> searchParams,
                                            Map<String, Object> otherParams, Map<String, Object> merchantParams,
                                            Map<String, Object> sortParams, Integer pageIndex, Integer pageNum,
                                            Map<String, Object> gtParams, Map<String, Object> ltParams);


    /**
     * 根据商品编号查询订单id
     *
     * @param goodsNo
     * @return
     */
    public List<Long> getUserorderByGoodsNo(String goodsNo);

    /**
     * 查询用户订单集合
     *
     * @param params
     * @param searchParams
     * @param otherParams
     * @param merchantParams
     * @param sortParams
     * @param gtParams
     * @param ltParams
     * @return
     */
    public List<Userorder> getAllUserorderList(Map<String, Object> params, Map<String, Object> searchParams,
                                               Map<String, Object> otherParams, Map<String, Object> merchantParams,
                                               Map<String, Object> sortParams, Map<String, Object> gtParams, Map<String, Object> ltParams);

    /**
     * 根据主订单号获取子订单号
     *
     * @param orderNo
     * @return
     */
    public String getUserorderByTopOrderNo(String orderNo);

    /**
     * 获取订单总数
     */
    public Integer getUserorderCount(Map<String, Object> params, Map<String, Object> searchParams,
                                     Map<String, Object> otherParams, Map<String, Object> merchantParams,
                                     Map<String, Object> gtParams, Map<String, Object> ltParams);

    /**
     * 获取供应商可提现订单信息
     *
     * @param userorderList
     */
    public void getWithdrawUserorderMsg(List<Userorder> userorderList);

    /**
     * 获取供应商可提现订单信息
     *
     * @param userorder
     */
    public void getWithdrawUserorderMsg(Userorder userorder);

    /**
     * 提现订单导出工具
     *
     * @param request
     * @param userorderList
     * @return
     */
    public void toWithdrawUserorderExcel(HttpServletRequest request, List<Userorder> userorderList);

    /**
     * 生成对账对单查询
     *
     * @param params
     * @param noParams
     * @param searchParams
     * @param sortParams
     * @param gtParams
     * @param ltParams
     * @return
     */
    public List<Userorder> getUserorderByNoIds(Map<String, Object> params, Map<String, Object> noParams,
                                               Map<String, Object> searchParams, Map<String, Object> sortParams,
                                               Map<String, Object> gtParams, Map<String, Object> ltParams);

    public Userorder getForUpdate(Long id);


    /**
     * 获取导出订单数据
     *
     * @param param
     * @return
     */
    List<ExportOrderVO> listExportOrderByParam(Map<String, Object> param);

    /**
     * 获取平台提现订单数据
     *
     * @param params
     * @return
     */
    public List<ExportPlatformOrderVO> getExportPlatformOrder(Map<String, Object> params);

    /**
     * 获取商户提现订单数据
     *
     * @param params
     * @return
     */
    List<ExportMerchantOrderVO> listExportMerchantOrder(Map<String, Object> params);

}